<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>demo-service</title>
</head>
<body>
<h1>Demo Service</h1>
<script>
  // TODO 采坑记录，如果是跨域请求，每次 JSESSIONID 都在变，需要配置 {credentials: 'include'}
  fetch(`http://${location.host}/login`, {
    method: 'POST',
    credentials: 'include',
    headers: {'Content-Type': 'application/json;charset=utf-8'},
    body: JSON.stringify({
      username: 'admin',
      password: 'superadmin'
    })
  }).then((res) => res.json()).then(json => {
    console.log(json)
  })
</script>
</body>
</html>
